
import SpecialPersonAPI from '../api/specialperson.js';

export const SpecialPerson={
   state:{
      specialpersonlist:[],
      specialperson_total_count:0,
      interviewrecord:[]
   },
   mutations:{
      setSpecialPersonList(state,list){
          state.specialpersonlist=list;
      },
      setSpecialPersonTotalCount(state,total_count){
          state.specialperson_total_count=total_count;
      },
      setInterviewRecord(state,list){
          state.interviewrecord=list;
      }
   },
   actions:{
      loadSpecialPersonList(context,data){
          SpecialPersonAPI.getSpecialPersonList(data).then(function(response){
              if(response.data.code==1){
                  context.commit('setSpecialPersonList',response.data.list);
                  context.commit('setSpecialPersonTotalCount',response.data.total_count);
              }
          })
      },
      loadInterviewRecord(context,data){
          SpecialPersonAPI.getInterviewRecord(data).then(function(response){
              if(response.data.code==1){
                  context.commit('setInterviewRecord',response.data.list);
              }
          })
      }
   },
   getters:{
      getSpecialPersonList:state =>{
         return state.specialpersonlist
      },
      getSpecialPersonTotalCount: state =>{
         return state.specialperson_total_count
      },
      getInterviewRecord:state =>{
         return state.interviewrecord;
      }
   }
}
